PEGetSQLQuery

Use PEGetSQLQuery to retrieve the same query that appears in the Show SQL Query dialog box in Crystal Reports, in a syntax that's specific to the database driver you're using. Use this function with PEGetHandleString. Use PESetSQLQuery, to update the query. See Remarks below.

C Syntax
BOOL CRPE_API PEGetSQLQuery (
        short printJob,
        HANDLE FAR *textHandle,    
        short FAR *textLength );
Parameters

printJob

Specifies the print job from which you want to retrieve the SQL query.

textHandle

Specifies a pointer to the handle of the string containing the SQL query string.

textLength

Specifies a pointer to the length of the SQL query string (in bytes) including the terminating byte.

Returns
Remarks

The report must be logged on before the call to PEGetSQLQuery is made.

VB Syntax

VB Sample Code for modifying SQL statements

Declare Function PEGetSQLQuery Lib "crpe32.dll" ( ByVal printJob As 
Integer, TextHandle As Long, TextLength As Integer ) As Integer
Delphi Syntax

Delphi code for getting/setting the SQL query

function PEGetSQLQuery (
    printJob: Word;
    var textHandle: HWnd;
    var textLength: Word
    ): Bool stdcall;


Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com